package com.nit.netty.client.controller;

import com.nit.netty.common.service.GoodbyeService;
import com.nit.netty.common.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: whb
 * @Description:
 * @CreateTime: 2020/8/21 14:10
 */
@RestController
@RequestMapping("/api")
public class HelloController {

    @Autowired
    private HelloService helloService;
    @Autowired
    private GoodbyeService goodbyeService;

    @GetMapping("/hello")
    public String hello(@RequestParam("msg")String msg) {
        return helloService.hello(msg);
    }

    @GetMapping("/bye")
    public String bye(@RequestParam("msg")String msg) {
        return goodbyeService.bye(msg);
    }

}
